<?php

use swap\visitor;

class my_right_nav_helper extends \swap\helper {
    
    public static function run($context) {
        $id = visitor::get_value('id');
        self::set('id', $id);
        
        // name
        $controller_name = visitor::get_controller_name();
        switch ($controller_name) {
            case 'user_info':
                $name = '个人信息';
                break;
            case 'language':
                $name = '语言能力';
                break;
            case 'training':
                $name = '培训经历';
                break;
            case 'letter':
                $name = '求职信';
                break;
            case 'certificate':
                $name = '证书';
                break;
            case 'picture':
                $name = '照片';
                break;
            case 'attachment':
                $name = '附件';
                break;
            case 'other':
                $name = '其他信息';
                break;
            default :
                $name = '未知标题';
        }
        self::set('name', $name);
        
        // 5个星星显示状态
        $five_stars_status = resume_service::five_stars_status(visitor::get_value('resume')->degree);
        self::set('five_stars_status', $five_stars_status);
        
        self::render();
    }
    
}